<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>个人中心</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <style>
        .fakeimg {
            height: 200px;
            background: #aaa;
        }
    </style>

    <style th:inline="text">
        body {
            background: url("asserts/img/bg5.jpg");
        }
    </style>

</head>
<body>

<div class="container" style="width: 1300px">

    <div class="jumbotron text-center" style="background: #2E2D3C">
        <h2 style="font-family: 华文新魏;color: #fcfcfc;font-size: 50px">个人中心</h2>
    </div>

    <nav class="navbar navbar-inverse">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>

                <a style="font-family: 华文新魏;color: #FC9D9A;font-size: 28px" class="navbar-brand"
                   th:href="@{/backendToNews(userid=${user.userid})}">返回论坛主页</a>
            </div>
            <div class="collapse navbar-collapse" id="myNavbar">
                <ul class="nav navbar-nav">

                </ul>
            </div>
        </div>
    </nav>

    <div class="container">
        <div class="row">
            <div class="col-sm-4">
                <h2 style="font-family: 华文新魏;color: #1b6d85">个人信息</h2>

                <div class="fakeimg" style="width: 10px;height: 10px"><img src="asserts/img/avatar.jpg"></div>

                <hr class="hidden-sm hidden-md hidden-lg">
            </div>
            <div class="col-sm-8">
                <table class="table table-hover">

                    <thead>
                    <br>
                    <br>
                    <br>
                    <br>

                    </thead>
                    <tbody>
                    <tr class="warning">
                        <td style="font-family: 华文新魏;color: #1b6d85">ID(不可修改)</td>
                        <td style="font-family: 华文新魏;color: #1b6d85">[[${user.userid}]]</td>
                    </tr>
                    <tr class="warning">
                        <td style="font-family: 华文新魏;color: #1b6d85">名字</td>
                        <td style="font-family: 华文新魏;color: #1b6d85">[[${user.username}]]</td>
                    </tr>
                    <tr class="warning">
                        <td style="font-family: 华文新魏;color: #1b6d85">联系电话</td>
                        <td style="font-family: 华文新魏;color: #1b6d85">[[${user.phone}]]</td>
                    </tr>

                    </tbody>
                </table>

                <!--==================修改信息-->

                <div class="panel-group" id="accordion" style="width: 720px">

                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h4 class="panel-title">
                                <a data-toggle="collapse" data-parent="#accordion"
                                   href="#collapseTwo">
                                    <button type="button" class="btn btn-success">点击修改</button>
                                </a>
                            </h4>
                        </div>
                        <div id="collapseTwo" class="panel-collapse collapse">
                            <div class="panel-body">
                                <div id="collapseOne" class="panel-collapse collapse in">
                                    <div class="panel-body">
                                        <!--表单-->
                                        <form th:action="@{/toChangeUserInfo}" class="form-horizontal" role="form">
                                            <input type="hidden" class="form-control"
                                                   th:value="${user.userid}" name="userid">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"
                                                       style="font-family: 华文新魏;color: #1b6d85">名字</label>
                                                <div class="col-sm-10">
                                                    <input style="font-family: 华文新魏;color: #1b6d85" type="text"
                                                           class="form-control"
                                                           th:value="${user.username}" name="username">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"
                                                       style="font-family: 华文新魏;color: #1b6d85">联系电话</label>
                                                <div class="col-sm-10">
                                                    <input type="text" class="form-control"
                                                           th:value="${user.phone}" name="phone">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label"
                                                       style="font-family: 华文新魏;color: #1b6d85">密码</label>
                                                <div class="col-sm-10">
                                                    <input type="password" class="form-control"
                                                           th:value="${user.password}" name="password">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <div class="col-sm-offset-2 col-sm-10">
                                                    <button type="submit" class="btn btn-info"
                                                            style="font-family: 华文新魏;color: #1b6d85">提交
                                                    </button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>

                <!--==============================================-->

            </div>
        </div>
    </div>


    <table class="table">
        <caption style="font-family: 华文新魏;color: #1b6d85;font-size: 30px">我的文章</caption>

        <thead>

        <tr style="font-family: 华文新魏;color: #1b6d85;font-size: 20px">

            <th>文章编号</th>
            <th>文章标题</th>
            <th>作者</th>
            <th>点击量</th>
            <th>创建时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>

        <tbody>
        <tr class="danger" th:each="article:${articleList}" style="font-family: 华文新魏;color: #1b6d85;font-size: 20px">
            <td>[[${article.articleid}]]</td>
            <td>[[${article.title}]]</td>
            <td>[[${article.author}]]</td>
            <td>[[${article.clicknum}]]</td>
            <td th:text="${#dates.format(article.buildtime, 'yyyy-MM-dd HH:mm')}"></td>
            <td>[[${article.status}]]</td>

            <td>
                <a th:href="@{/userDeleteArticle(articleid=${article.articleid},userid=${user.userid},status=${article.status})}">
                    <button type="button" class="btn btn-danger" th:text="删除"></button>
                </a>
                <a th:href="@{/toEditPage(userid=${user.userid},articleid=${article.articleid})}">
                    <button type="button" class="btn btn-info">编辑</button>
                </a>
            </td>
        </tr>
        </tbody>
    </table>
    <a th:href="@{/toEditPage(userid=${user.userid})}">
        <button type="button" class="btn btn-success" style="float: right">添加新文章</button>
    </a>


</div>


</body>
</html>